#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include<vector>
using namespace std;

int main() {
    int x = 0;
    cin >> x;
    vector<vector<int>> vv;
    vv.reserve(x);
    for (int i = 0; i < vv.size(); i++)
    {
        vv[i].resize(i + 1, 1);
    }
    for (int i = 0; i < vv.size(); i++)
    {
        for (int j = 1; j < vv[i].size() - 1; j++)
        {
            vv[i][j] = vv[i - 1][j] + vv[i - 1][j - 1];

        }
    }
    for (int i = 0; i < vv.size(); i++)
    {
        for (int j = 0; j < vv[i].size(); j++)
        {
            cout << vv[i][j] << " ";
        }
        cout << endl;
    }
    return 0;
}